package com.cheer.vo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.cheer.enums.LotteryActTypeEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel
public class AwardListVO {

    @TableId
    private Long id;

    @ApiModelProperty("奖品名称")
    private String awardName;

    @ApiModelProperty("库存")
    private Integer stock;

    @ApiModelProperty("活动名称")
    private String atcName;

    @ApiModelProperty("活动ID")
    private Integer atc;

    @ApiModelProperty("每日最大发放奖品数量")
    private Integer dailyMax;

    @ApiModelProperty("图标（暂时用不到）")
    private String icon;

    @ApiModelProperty("是否是积分")
    private Boolean isIntegral;

    @ApiModelProperty("单元")
    private Integer unitQuantity;

    @ApiModelProperty("对应前端页面中奖的index")
    private Integer index;

    @ApiModelProperty("开始投放时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startPut;

    @ApiModelProperty("结束投放时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endPut;

    public void setAtcNameByAct(){
        LotteryActTypeEnum byCode = LotteryActTypeEnum.getByCode(this.atc);
        this.setAtcName(byCode.getMessage());
    }

}
